# -*- coding: utf-8 -*-

import json
import jinja2
import os, sys

def AZ_IsFile(file="", type=""):
    result = False

    if os.path.isfile(file):
        result = True

        if type != "":
            type = "." + type
            result = file[-(len(type)):] == type

    return result


def L_AZ_CheckCfgJson(cfg_json=""):
    return AZ_IsFile(cfg_json, "json")

def L_AZ_CheckTempFile(temp_file=""):
    return AZ_IsFile(temp_file)


def AZ_Mould_FileBuild(cfg_json="", temp_file="", target_file=""):
    ret_code = 0
    ret_info = f"[{temp_file}] is successfully built to become [{target_file}] by [{cfg_json}]."

    if not L_AZ_CheckCfgJson(cfg_json):
        ret_info = f"file:[{cfg_json}], cfg_json is error. "
    elif not


    return (ret_code, ret_info)